<%@ taglib prefix="decorator" uri="http://www.opensymphony.com/sitemesh/decorator"%>
<%@ taglib prefix="display" uri="http://displaytag.sf.net"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>

<%@ taglib prefix="custom" uri="http://jfooball.it/functions"  %>

<html>
<head>
	<title>${custom:nationalCapitalize(team.name)}</title>    
</head>

<spring:url var="returnListURL" value="/teams/list.do" />

<spring:url var="imageURL" value="/teams/image.do"> 
   <spring:param name="id" value="${team.id}"></spring:param> 
</spring:url>

<spring:url var="listPlayersURL" value="/players/listByTeam.do">
	<spring:param name="team.id">${team.id}</spring:param>
	<spring:param name="teamCategory">1</spring:param>					
</spring:url>

<spring:url var="listStaffsURL" value="/staffs/listByTeam.do">
	<spring:param name="team.id">${team.id}</spring:param>
	<spring:param name="teamCategory">1</spring:param>					
</spring:url>


<body>
	
	<div style="margin-bottom: 20px; margin-left: 25px">
		<div id="menutop">
			<h3>
				<span class="label label-primary"><a href="#" class="targetLinkPlayers" data-division="${team.division.id}" data-nation="${team.nation.id}" title="<spring:message code="returnListTeam" />"><i class="fa fa-reply fa-lg"></i></a></span>
			</h3>
		</div>	
	</div>
				
	<form:form commandName="player" action="${returnListURL}" id="returnTeamsPageForm" method="POST">
		<input type="hidden" name="division.id" id="divisionId" />
		<input type="hidden" name="nation.id" id="nationId" />					 
	</form:form>
	
	<spring:url var="viewURL" value="/players/view.do" />
	
	<form:form commandName="player" action="${viewURL}" id="viewPlayerPageForm" method="GET">
		<input type="hidden" name="id" id="id" />
	</form:form>

	<table bordercolor="#111111">
		<tbody>
			<tr>
				<td valign="middle" style="margin: 15pt;">
						<div class="content">

							<table class="tabelle_spieler" cellSpacing="1" cellPadding="0">
								<tbody>
									<tr>
										<td class="ac verein_header_zelle_wappen" rowSpan="3" style="width: 100px; padding: 0px; padding-right: 3px; padding-left: 3px; margin: 0px; border-top-color: #bbb; border-right-color: #bbb; border-bottom-color: #bbb; border-left-color: #bbb; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; background-color: rgb(255, 255, 255);">
												<img alt="-" src="${imageURL}" style="width: 75%">
										</td>
										<td class="blau vm verein_header_table_gross_bg" style="background-color: rgb(14, 46, 128);">
											<h1 class="fff" style="vertical-alignment: middle">
												<span id="vereinsinfo" class="s18 tdn fff">${custom:nationalCapitalize(team.name)}</span>
												<span class="s10 fn fff">${custom:nationalCapitalize(team.nation.name)}</span>

												<sec:authorize access="hasAnyRole('ROLE_ADMIN')">
													<c:if test="${! empty team.lastTimeModify}">
														<img style="position: absolute" src="${pageContext.request.contextPath}/images/help.png" title="Aggiornato il: <fmt:formatDate pattern="dd/MM/yyyy - [HH:mm:SS]" value="${team.lastTimeModify}" /> da ${team.lastUserModify}">
													</c:if>
												</sec:authorize>												
											</h1>
										</td>
									</tr>
									<tr>
									<td>
										<img class="pfeil" alt="-" src="${pageContext.request.contextPath}/images/linkpfeil_b.gif">&nbsp;

										<a class="s10 fn" href="">Dirigenza</a>&nbsp;&nbsp;&nbsp;
										
										<a class="s10 fn" href="${listStaffsURL}">Staff</a>&nbsp;&nbsp;&nbsp;

										<a class="s10 fn" href="${listPlayersURL}">Giocatori</a>&nbsp;&nbsp;&nbsp;

										<a class="s10 fn" href="">Stadio</a>&nbsp;&nbsp;&nbsp;
									</td>
								</tr>
									<tr>
										<td>
										</td>
									</tr>
								</tbody>
							</table>	
							
						</div>
					</td>
			</tr>
		</tbody>
	</table>
	
	
    <%-- DWR SCRIPTS --%>
    <script type='text/javascript' src='${pageContext.request.contextPath}/dwr/engine.js'></script>
    <script type='text/javascript' src='${pageContext.request.contextPath}/dwr/util.js'></script>
    <script type='text/javascript' src='${pageContext.request.contextPath}/dwr/interface/nationService.js'></script>	
    <script type='text/javascript' src='${pageContext.request.contextPath}/dwr/interface/teamService.js'></script>	
    <script type='text/javascript' src='${pageContext.request.contextPath}/dwr/interface/positionService.js'></script>	    
    <script type='text/javascript' src='${pageContext.request.contextPath}/dwr/interface/playerService.js'></script>
    <script type='text/javascript' src='${pageContext.request.contextPath}/dwr/interface/divisionService.js'></script>    
    

    <%-- FUNCTION SPECIFIC --%>
    <script type="text/javascript" src="${pageContext.request.contextPath}/scripts/player.js"></script> 
    <script type="text/javascript" src="${pageContext.request.contextPath}/scripts/staff.js"></script>	
	

</body>
</html>